

import CesiumNavigation from "./plugins/cesium-navigation-es6/viewerCesiumNavigationMixin";
import { Cesium3DTileset, Ion,createWorldTerrain, IonResource, Viewer ,CesiumTerrainProvider,WebMapTileServiceImageryProvider,KmlDataSource,HeadingPitchRange} from 'cesium';
import {baseMapurl} from './config/mapconfig'
import "cesium/Build/Cesium/Widgets/widgets.css";
import "./css/main.css";
import {inittoolBar,initwaterPlayer,initareaNav,initWithDrawMgr,initMiniMap} from './plugins/inistallwidget'
import {createModel} from "./plugins/ModelControl/addmodel"
Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1MjI0NjBhZi0xMDZkLTQyOWUtOTQ3OC1lMjdjZTQ0OGMyYmQiLCJpZCI6MTkyOTcsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NzUzMzYzMzR9.ejj73f-8e0bIAzNYNfeCq6_lo7zMDSw4_MVJyIXwV1s"
var viewer = new Viewer('cesiumContainer', {
    //  terrainProvider: createWorldTerrain(),
    terrainProvider:new CesiumTerrainProvider({
        url:"http://113.240.224.29:8062/gisTerrain",
        minimumLevel: 0,
        maximumLevel: 19,
    }),
    imageryProvider:new WebMapTileServiceImageryProvider({
        url:baseMapurl,
        layer: "tdtBasicLayer",
        style: "default",
        format: "image/jpeg",
        tileMatrixSetID: "GoogleMapsCompatible",
        show: false
    }),
    timeline:false,
    animation:false,
    shouldAnimate : true,
    homeButton:false,
    infoBox:false,
    baseLayerPicker:false,
    geocoder:false,
    navigationHelpButton:false,
    scene3DOnly:true,
    fullscreenButton:false
});
viewer.scene.globe.depthTestAgainstTerrain = true;
// viewer.zoomTo(tileset);
inittoolBar(viewer)
// initlayerManage(viewer)
// initwaterPlayer(viewer)
initareaNav(viewer)
CesiumNavigation(viewer, {});
 createModel(viewer,"http://113.240.224.29:8062/gisdata/Animate.glb",{
    id:"test111",
    title:"",
    height:320,
    lng:102.623,
    lat: 20.5785,
    heading:-40,
    pitch:0,
    roll:0,
    scale:1.2
})

